import fs from "node:fs";
import jsyaml from "js-yaml";
import knex from "knex";
interface DbConfig {
    host: string;
    port: number;
    user: string;
    password: string;
    database: string;
}
const yaml = fs.readFileSync(__dirname + "/db.config.yaml", "utf8");
const config = jsyaml.load(yaml) as { db: DbConfig };
const db = knex({
    client: "mysql2",
    connection: config.db,
});
export default db;
